import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PermissionService } from './permission.service';
import { PermissionInitService } from './permission-init.service';
import { Permission } from '../../entities/permission.entity';
import { RoleModule } from '../role/role.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([Permission]),
    forwardRef(() => RoleModule), // 使用 forwardRef 解决循环依赖
  ],
  providers: [PermissionService, PermissionInitService],
  exports: [PermissionService],
})
export class PermissionModule {}
